package com.hushan.elevator.service;

import com.hushan.elevator.model.Department;
import com.hushan.elevator.model.User;

import java.util.List;

public interface DeptService {
    Department findDeptById(Integer id);

    void saveDepartment(Department department);

    long findDeptCount(Department department);

    int findChildrenDeptCount(int deptId);
    List<Department> findChildByDeptId(Integer deptId);

    void deleteDepartment(Department department);

    Department findDeptByUserId(int userId);

    List<Department> findDeptByParentId(Integer parentId);

    boolean detectDeptAuth(String ancestor, int s);

    boolean findIsAncestors(Department parent, Department son);

    boolean findUserPermissionForDept(User user, Department dept);

    boolean findUserPermissionForDept(User user, int deptId);
}
